<template>
	<view>
		<view class="header">
			<u-navbar title="车次详情" back-icon-size='44' :background="background" title-color="#FFFFFF" :border-bottom='false'
			 back-icon-color='#071D42'>
				<view slot='right' style="padding-right: 32rpx;">
					<u-icon name="reload" color="#FFFFFF" size="44"></u-icon>
				</view>
			</u-navbar>
			<view class="infoBox">
				<view class="start">
					<view class="date">
						01月29日 周五
					</view>
					<view class="time">
						11:00
					</view>
					<view class="station">
						深圳东站
					</view>
				</view>
				<view class="checi">
					<view class="num">
						K502
					</view>
					<view class="cheinfo">
						<text>经停信息</text>
					</view>
				</view>
				<view class="end">
					<view class="date">
						01月29日 周五
					</view>
					<view class="time">
						12:50
					</view>
					<view class="station">
						常德站
					</view>
				</view>
			</view>
			<view class="datePicker">
				<view class="pre">
					前一天
				</view>
				<view class="date">
					02-04 周四 <u-icon name="arrow-down" size="28"></u-icon>
				</view>
				<view class="next">
					后一天
				</view>
			</view>
			<view class="tips">
				<image src="../../../static/imgs/huopeo.png" mode=""></image>该车次已实行电子客，可刷证件进站
			</view>
		</view>

		<view class="trainBox">
			<view class="train-ul">
				<view class="top">
					<view class="">
						抢票成功率: 硬座 <text style="color: #F57426;margin: 0 12rpx;">中等</text> 硬卧 <text style="color: #F57426;margin: 0 12rpx;">中等</text>
					</view>
					<view class="tip">
						抢票人数较多，可多选车次和坐席提高成功率
					</view>
				</view>
				<view class="train-li">
					<view class="type">
						硬座
					</view>
					<view class="price">
						<text style="font-size: 24rpx;">¥</text>280.5
					</view>
					<view class="num">
						无票
					</view>
					<view class="btns" @click="navTo('./trainBuy')">
						候补抢票
					</view>
				</view>
				<view class="train-li">
					<view class="type">
						硬卧
					</view>
					<view class="price">
						<text style="font-size: 24rpx;">¥</text>280.5
					</view>
					<view class="num">
						无票
					</view>
					<view class="btns">
						候补抢票
					</view>
				</view>
				<view class="train-li">
					<view class="type">
						软卧
					</view>
					<view class="price">
						<text style="font-size: 24rpx;">¥</text>280.5
					</view>
					<view class="num">
						有票
					</view>
					<view class="ydbtns" @click="navTo('./trainOrder')">
						预定
					</view>
				</view>
				<view class="train-li">
					<view class="type">
						无座
					</view>
					<view class="price">
						<text style="font-size: 24rpx;">¥</text>280.5
					</view>
					<view class="num">
						有票
					</view>
					<view class="ydbtns">
						预定
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: 'rgba(255,255,255,0)'
				}
			}
		},
		methods:{
			navTo(url){
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.header {
		width: 100%;
		height: 606rpx;
		background: linear-gradient(180deg, #3DA4FE 0%, #3587F7 74%, rgba(45, 123, 247, 0) 100%);

		.infoBox {
			padding: 0 28rpx;
			display: flex;
			justify-content: space-between;

			.start,
			.checi,
			.end {
				display: flex;
				flex-direction: column;
				align-items: center;
				color: #FFFFFF;

				.date {
					font-size: 24rpx;
					font-family: Alibaba Sans;
					font-weight: 400;
				}

				.time {
					font-size: 40rpx;
					font-family: Alibaba Sans;
					font-weight: bold;
					margin-top: 8rpx;
					margin-bottom: 8rpx;
				}

				.station {
					font-size: 28rpx;
					font-family: Segoe UI;
					font-weight: 400;
				}

				.num {
					padding-top: 20rpx;
				}

				.cheinfo {
					margin-top: 8rpx;
					border-radius: 40rpx;
					font-size: 24rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #FFFFFF;
					display: flex;
					align-items: center;

					text {
						display: inline-block;
						width: 128rpx;
						height: 36rpx;
						border: 2rpx solid #FFFFFF;
						border-radius: 40rpx;
						text-align: center;
					}

					&:before {
						content: " ";
						display: inline-block;
						width: 32rpx;
						height: 2rpx;
						background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, #FFFFFF 100%);
						border-radius: 4rpx;
					}

					&:after {
						content: " ";
						display: inline-block;
						width: 32rpx;
						height: 2rpx;
						background: linear-gradient(90deg, #FFFFFF 0, rgba(255, 255, 255, 0.02) 100%);
						border-radius: 4rpx;
					}
				}
			}
		}

		.datePicker {
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 28rpx;
			font-family: Segoe UI;
			font-weight: 400;
			color: #FFFFFF;
			padding: 28rpx 28rpx 0;

			.date {
				width: 224rpx;
				height: 60rpx;
				background: rgba(255, 255, 255, 0.3);
				border-radius: 4px;
				color: #FFFFFF;
				text-align: center;
				line-height: 60rpx;
			}
		}

		.tips {
			width: 694rpx;
			height: 80rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			margin: 36rpx auto 0;
			display: flex;
			align-items: center;
			padding-left: 20rpx;

			image {
				width: 24rpx;
				height: 24rpx;
				margin-right: 6rpx;
			}
		}
	}

	.trainBox {
		padding: 0 28rpx;
		margin-top: -150rpx;

		.train-ul {
			width: 100%;
			height: 295px;
			background-color: #FFFFFF;
			border-radius: 16rpx;
			padding: 0 24rpx;

			.top {
				width: 100%;
				height: 110rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				font-size: 28rpx;
				font-family: Segoe UI;
				font-weight: 400;
				color: #333333;

				.tip {
					font-size: 24rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #999999;
				}
			}

			.train-li {
				width: 100%;
				height: 120rpx;
				border-bottom: 2rpx solid #F2F2F7;
				display: flex;
				align-items: center;

				&:last-child {
					border-bottom: none
				}

				.type {
					font-size: 32rpx;
					font-family: Segoe UI;
					font-weight: bold;
					color: #333333;
				}

				.price {
					font-size: 32rpx;
					font-family: Arial;
					font-weight: 400;
					color: #F57426;
					margin-left: 134rpx;
				}

				.num {
					font-size: 28rpx;
					font-family: Segoe UI;
					font-weight: bold;
					color: #333333;
					margin-left: 122rpx;
				}

				.btns {
					margin-left: auto;
					width: 132rpx;
					height: 56rpx;
					background: linear-gradient(90deg, #40A5F9 0%, #3279F2 100%);
					border-radius: 8rpx;
					text-align: center;
					line-height: 56rpx;
					font-size: 28rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #FFFFFF;
				}
				.ydbtns {
					margin-left: auto;
					width: 132rpx;
					height: 56rpx;
					background: linear-gradient(90deg, #FEA837 0%, #FF7700 100%);
					border-radius: 8rpx;
					text-align: center;
					line-height: 56rpx;
					font-size: 28rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #FFFFFF;
				}
			}
		}
	}
</style>
